#include <stdio.h>
#include "http/http_linux.h"

int main() {
    printf("Hello, World!\n");

    char *host="127.0.0.1";
    int port = 8080;
    char *uri="/hello?name=Tom";
    char *params="name=Grant&age=19";
    char *response;

    //http_get(host,port,uri,&response);
    //printf("Http GET Response>>%s\n",response);

    //uri="/say";
    //http_post(host,port,uri,params,&response);
    //printf("Http POST Response>>%s\n",response);

    uri="/hi/9";
    char *data = "{\"username\":\"zhangshan\",\"email\":\"33333@qq.com\",\"phone\":\"10987654321\"}";

    setContentType("application/json;charset=UTF-8");
    http_post(host,port,uri,data,&response);
    printf("Http POST Response>>%s\n",response);

    uri="/you";

    setContentType("application/json;charset=UTF-8");
    http_post(host,port,uri,data,&response);
    printf("Http POST Response>>%s\n",response);


    return 0;
}